#include "../head.h"

class bottle
{
public:
    // 如果加上explicit修饰符，表面无法进行隐式类型转换，因此表达式bottle b1 = 5, 5无法被转换为bottle类型对象，故报错
    // explicit
    bottle(double width, double length = 0.5) : m_width(width), m_length(length) {}

    double calSquare()
    {
        return m_width*m_length;
    }

private:
    double m_width, m_length;
};

int main()
{
    bottle b1 = 5;
    cout << b1.calSquare() << endl;
}